<?
$per_page =14;
$pro_homes = getArray('xteam_product','status=1','0,'.$per_page,'is_hot DESC,date_added DESC, sort ASC');?>
<div class="block-news">
<?
if($pro_homes){
    $col=0;
    foreach($pro_homes as $pro_home){;
        
        $col++;
        $class = $col%2!=0? 'block-left' : 'block-right';
        if($parid[$pro_home['parent_id']]%2==0){$class_sp="rental";}else{$class_sp="salse";}
        $properties = product_properties($pro_home['id']);
        ?>
        <div class="<?=$class?>">
            <h3 class="title-news">
                <?=$pro_home['is_hot']==1?'<img src="'.$curHost.'images/hot.gif" alt="'.utf8_to_ascii($pro_home['name']).'" />':''?>
                <a href="<?=$curHost.str_replace(array('--','--'), '-', utf8_to_ascii($parname[$pro_home['parent_id']])).'/'.str_replace(array('--','--'), '-', utf8_to_ascii($parseokey[$pro_home['parent_id']]))?>/7/<?=$parid[$pro_home['parent_id']]?>.html">
                    <span class="<?=$class_sp?>"><?=$parname[$pro_home['parent_id']]?> | </span>
                </a>
                <a href="<?=$curHost.$parent=$parseokey[$pro_home['parent_id']]!=''?$parseokey[$pro_home['parent_id']]:utf8_to_ascii($parname[$pro_home['parent_id']])?>/<?=str_replace(array('--','--'), '-', utf8_to_ascii($name=$pro_home['seo_key']!=''?$pro_home['seo_key']:$pro_home['name']))?>/1/<?=$pro_home['id']?>.html" title="<?=$pro_home['name']?>">
                    <?=$pro_home['name']?>
                </a>

            </h3>
        <? if($pro_home['image_thumbs']!=''){?>
            <a href="<?=$curHost.$parent=$parseokey[$pro_home['parent_id']]!=''?$parseokey[$pro_home['parent_id']]:utf8_to_ascii($parname[$pro_home['parent_id']])?>/<?=str_replace(array('--','--'), '-', utf8_to_ascii($name=$pro_home['seo_key']!=''?$pro_home['seo_key']:$pro_home['name']))?>/1/<?=$pro_home['id']?>.html" title="<?=$pro_home['name']?>">
                <img src="<?=$curHost.$pro_home['image_thumbs']?>" alt="<?=$pro_home['seo_key'].'-'.$pro_home['name']?>" class="img-news" title="<?=$pro_home['name']?>" />
            </a>
        <? }else{?>
            <a href="<?=$curHost.$parent=$parseokey[$pro_home['parent_id']]!=''?$parseokey[$pro_home['parent_id']]:utf8_to_ascii($parname[$pro_home['parent_id']])?>/<?=str_replace(array('--','--'), '-', utf8_to_ascii($name=$pro_home['seo_key']!=''?$pro_home['seo_key']:$pro_home['name']))?>/1/<?=$pro_home['id']?>.html" title="<?=$pro_home['name']?>">
                <img src="<?=$curHost?>images/no_image.gif" alt="<?=$pro_home['seo_key']." - ".$pro_home["name"]?>"  class="img-news" style="display: inline;" title="<?=$pro_home['name']?>" />
            </a>
        <? }?>
            <div class="short-news">
                <ul>
                <?
                if($properties){
                    foreach($properties as $prop){?>
                    <li><label><?=$prop['cat']?>:&nbsp;</label><span><?=$prop['name']?></span></li>
                <?
                    }
                }else{?>
                    <li><label>đang cập nhật</label></li>
                <? }?>
                </ul>
            </div>
        </div>

        <?
        if($col%2==0 || $col>=count($pro_homes))
            echo '<div class="clear"></div></div><div class="block-news">';
    }
}
?>
</div>
<script language="javascript" type="text/javascript">
    $(document).ready(function(){
        var contentdiv = $('.block-news').text(function(){
            if ($.trim($(this).text())==''){
                $(this).hide();
            }
        });
    })
</script>